package com.xj.homework.pattern.singleton;

public class DoubleCheckSingleTon {

    public static DoubleCheckSingleTon instance;

    private DoubleCheckSingleTon() {}

    public static DoubleCheckSingleTon getInstance() {
        if (instance == null) {
            synchronized (DoubleCheckSingleTon.class) {
                if (instance == null) {
                    instance = new DoubleCheckSingleTon();
                }
            }
        }
        return instance;
    }
}
